package com.dk.hi.gui.states;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.BasicGameState;
import org.newdawn.slick.state.StateBasedGame;

import com.dk.hi.gui.comp.ExplorationGUI;
import com.dk.hi.gui.view.ExplorationView;

public class ExplorationState extends BasicGameState {
	/**
	 * The Graphic User Interface
	 */
	ExplorationGUI gui;

	/**
	 * Exploration view
	 */
	ExplorationView view;

	public ExplorationState() throws SlickException {
		this.gui = new ExplorationGUI();
		this.view = new ExplorationView();
	}

	@Override
	public int getID() {
		return State.EXPLORATION;
	}

	@Override
	public void init(GameContainer container, StateBasedGame game) throws SlickException {
	}

	@Override
	public void render(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
		// Render the view first
		this.view.render(g);

		// Then the GUI
		this.gui.render(g);
	}

	@Override
	public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException {
		// Update the view first
		this.view.update(container, game, delta);

		// Then the GUI
		this.gui.update(container, game, delta);
	}

}
